// 运行时配置

import { RunTimeLayoutConfig } from "@umijs/max";
import HeadPortrait from "./layout/header/HeadPortrait";

// 全局初始化数据配置，用于 Layout 用户信息和权限初始化
// 更多信息见文档：https://umijs.org/docs/api/runtime-config#getinitialstate


export async function getInitialState(): Promise<{ name: string }> {
  return { name: 'panda kami' };
}

export const layout:RunTimeLayoutConfig  = () => {
  return {
    title: 'Panda Kamis',
    logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg',
    layout:"mix",
    onMenuHeaderClick:()=>{
      console.log('click');
    },
    avatarProps:{
    render(avatarProps, defaultDom, props) {
      console.log(props);
      
      return <HeadPortrait props={props}/>;
    },
    },
    // navTheme:'realDark',
    // 默认布局调整
    menu: {
      locale: false,
      defaultOpenAll: true, 
    },
  };
};
